package cn.bearspark.merit.provider.rpc;

import cn.bearspark.merit.provider.service.AccMeritService;
import cn.bearspark.merit.rpc.AccMeritRpc;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

/**
 * @author f
 */
@Component
@DubboService
public class AccMeritRpcImpl implements AccMeritRpc {

    private final AccMeritService accMeritService;

    public AccMeritRpcImpl(AccMeritService accMeritService) {
        this.accMeritService = accMeritService;
    }

    @Override
    public boolean isMerited(long userId, int moduleCode, long moduleDataId) {
        return accMeritService.isMerited(userId, moduleCode, moduleDataId);
    }

    @Override
    public void meritArticle(long userId, int moduleCode, long moduleDataId) {
        accMeritService.meritArticle(userId, moduleCode, moduleDataId);
    }
}
